package com.xiong.selenium.util;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class WebDriverUtil {

    public static WebElement getWebElementById(WebDriver webDriver,String id){
        // 定位要获取标签代码的元素
        WebElement element = webDriver.findElement(By.id(id));
        return element;
    }

    public static String getWebElementHtmlCode(WebElement webElement){
        // 获取元素的网页标签代码
        String outerHtml = webElement.getAttribute("outerHTML");
        return outerHtml;
    }
}
